﻿@using X.PagedList.Mvc.Core
@using X.PagedList.Mvc.Core.Common

@model X.PagedList.StaticPagedList<Moonglade.Model.PostListEntry>

@if (Model.Count == 0)
{
    <div class="alert alert-info">
        @Localizer["No Posts Found"]
    </div>
    <div class="mb-4"></div>
}
else
{
    foreach (var item in Model)
    {
        <partial name="_PostListEntry" model="item" />
        <div class="mb-4 d-none d-md-block"></div>
        <hr class="d-none d-md-block" />
    }

    @Html.PagedListPager(Model, page => $"?page={page}", new PagedListRenderOptions
    {
        LiElementClasses = new[] { "page-item" },
        PageClasses = new[] { "page-link" },
        UlElementClasses = new[] { "pagination justify-content-end" },
        MaximumPageNumbersToDisplay = 5,
        DisplayEllipsesWhenNotShowingAllPageNumbers = false
    })
}